﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for DonViTinhEntity
/// </summary>
public class DonViTinhEntity
{

    private int maDVT;
    private string tenDVT;
    public DonViTinhEntity()
    { }
    public DonViTinhEntity(int maDVT, string tenDVT)
    {
        this.maDVT = maDVT;
        this.tenDVT = tenDVT;
    }
    public int MaDVT
    {
        get { return this.maDVT; }
        set
        {
            if (value == null)
                throw new Exception("maDVT not allow nullvalue.");
            this.maDVT = value;
        }
    }
    public string TenDVT
    {
        get { return this.tenDVT; }
        set { this.tenDVT = value; }
    }
    public override string ToString()
    {
        return this.maDVT + "; " + this.tenDVT + "; ";
    }
    public override bool Equals(Object obj)
    {
        DonViTinhEntity me = (DonViTinhEntity)obj;
        bool ret = this.MaDVT.Equals(me.MaDVT);
        return ret;
    }
    public override int GetHashCode()
    {
        return this.MaDVT.GetHashCode();
    }

}